package com.study.service.impl.base;

import com.study.service.MessageService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @desc:
 * @author: panxiyi
 * @date: 2023/5/9 12:31 下午
 */
//@Service
public class MessageServiceImpl implements MessageService {

    List<String> queue = new ArrayList<>();

    @Override
    public void sendMessage(String id) {
        System.out.println("加入队列");
        queue.add(id);
    }

    @Override
    public String doSendMessage() {
        System.out.println("消费、发送短信");
        String removeId = queue.remove(0);
        return removeId;
    }
}
